<!--本页面为前台展现页面示例与规范，请研发人员仔细阅读-->
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
    String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <!--除index.jsp外其它页面 title 均写英文文件名，不含后缀名-->
    <title>template</title>
    <!--所有页面均引入common.jsp -->
    <%@ include file="../include/common.jsp"%>

    <script type="text/javascript">

	function init(){
	    var probeId = $("#probeId").val();
	    var collectorName = $("#collectorName").val();
	    $.ajax({
	      type: "POST", 
          url: "/bsm/test/collect-test!getCollectorParamMeta.action", //请求的action
		  data: {probeId:probeId,collectorName:collectorName}, //传的参数
		  dataType: 'json',
		  success: function(data){ //结果
		    var  tr0 = "<form id='centerForm' name='centerForm' action='/bsm/test/collect-test!collect.action' method='post'>";
		   tr0 += " <table id='testTable' name='testTable' class='form_main tableborder' border='0' cellpadding='5' cellspacing='0' width='68%'>";
		   tr0 += "<tr><td class='label' width='30%''>ProbeID：</td><td class='input' colspan='2'><input size='80' type='text' id='probeId' name='probeId' maxlength='150' value='"+probeId+"' /><span class='red'>*</span></td></tr>"; 
		   tr0 += "<tr><td class='label' width='30%''>采集程序类名：</td><td class='input' colspan='2'><input size='80' type='text' id='collectorName' name='collectorName' maxlength='150' value='"+collectorName+"' /><span class='red'>*</span></td></tr>";
		   tr0 += "<tr><td class='label' width='30%''>被监控资源IP：</td><td class='input' colspan='2'><input size='80' type='text' id='resIp' name='resIp' maxlength='150' value='' /><span class='red'>*</span></td></tr>";
		    var p = data;
		    for(var i =0 ;i<data.length; i++){
		     tr0 += "<tr><td class='label' width='30%''>"+data[i]+"：</td><td class='input' colspan='2'><input size='80' type='text' id='"+data[i]+"' name='"+data[i]+"' maxlength='150' value='' /><span class='red'>*</span></td></tr>";
		    }
		    tr0 += " <tr><td colspan='3' align='center'><input type='button' value='开始采集' class='button' onclick='collect();'/>";
             tr0 +=  "<input type='reset' name='reset' value='重置' class='button'  /> <div id='centermsg' class='red' style='display: none'></div></td> </tr>";
		     tr0 += "</table>";
		     tr0 += "</form>";
		  var testTable = document.getElementById("div1");
          testTable.innerHTML = tr0;
		  }
       });
	}
	
	function collect(){
	   $("#centerForm").submit();
	}
	
    </script>
</head>
<body>
	<div id="iframeDiv" style="clear: both; height: 100%; width: 100%;">
        <div class="content">
            <div class="content_title_bg">
                <div class="content_title">
                    当前位置:测试页面
                </div>
            </div>
            <div style="height: 100%; overflow: auto; padding: 0px;" id="center">
                <div id="div1">
                 <table class="form_main tableborder" border="0" cellpadding="5"
                            cellspacing="0" width="68%">
                            <tr>
                                <td class="label" width="30%">
                                    ProbeID：
                                </td>
                                <td class="input" colspan="2">
                                    <input size="80" type="text" id="probeId" name="probeId" maxlength="150"
                                        value="${probeId}" /><span class="red">*</span>
                                </td>
                            </tr>
                            <tr>
                                <td class="label" width="30%">
                                    采集程序类名：
                                </td>
                                <td class="input" colspan="2">
                                    <input size="80" type="text" id="collectorName" name="collectorName"
                                        maxlength="150" value="${collectorName}" /><span class="red">*</span>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="3" align="center">
                                    <input type="button" value="提交" class="button"
                                        onmouseover="this.className='buttonhover'"
                                        onmouseout="this.className='button'"  onclick="init();"/>
                                    <input type="reset" name="reset" value="重置" class="button"
                                        onmouseover="this.className='buttonhover'"
                                        onmouseout="this.className='button'" value="reset" />
                                    <div id="centermsg" class="red" style="display: none">
                                    </div>
                                </td>
                            </tr>
                        </table>
  			    </div> 
            </div>
        </div>
	</div>
</body>
</html>